## Loading required package: lattice
## Loading required package: ggplot2
## Warning: package 'dplyr' was built under R version 3.5.2
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Warning: package 'e1071' was built under R version 3.5.2
## Warning: package 'stringr' was built under R version 3.5.2
## Warning: package 'ggmap' was built under R version 3.5.2
## Google's Terms of Service: https://cloud.google.com/maps-platform/terms/.
## Please cite ggmap if you use it! See citation("ggmap") for details.
## Warning in train.default(x, y, weights = w, ...): cannnot compute class
## probabilities for regression
## k-Nearest Neighbors 
## 
## 3570 samples
##    2 predictor
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 3214, 3213, 3213, 3212, 3213, 3212, ... 
## Resampling results across tuning parameters:
## 
##   k   RMSE      Rsquared   MAE     
##    4  11.95853  0.6626195  5.588454
##    8  11.99820  0.6598352  5.698957
##   12  12.00540  0.6592070  5.773503
##   20  12.24638  0.6444100  6.037099
##   24  12.22998  0.6457030  6.068869
## 
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was k = 4.
## [1] 13.25783
## Warning in train.default(x, y, weights = w, ...): cannnot compute class
## probabilities for regression
## k-Nearest Neighbors 
## 
## 4463 samples
##    2 predictor
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 4016, 4017, 4016, 4016, 4017, 4018, ... 
## Resampling results across tuning parameters:
## 
##   k   RMSE      Rsquared   MAE     
##    4  16.52464  0.6265720  7.316553
##    8  15.91905  0.6499748  7.088565
##   12  16.07426  0.6423491  7.204544
##   20  16.34915  0.6301304  7.458690
##   24  16.55004  0.6207053  7.605018
## 
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was k = 8.
## [1] 3.041083
## [1] 13.5684
## Warning in train.default(x, y, weights = w, ...): cannnot compute class
## probabilities for regression
## k-Nearest Neighbors 
## 
## 4463 samples
##    2 predictor
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 4016, 4018, 4017, 4015, 4017, 4017, ... 
## Resampling results across tuning parameters:
## 
##   k   RMSE      Rsquared   MAE     
##    4  14.73045  0.7209207  6.265037
##    8  14.16945  0.7368472  6.113407
##   12  14.35738  0.7298605  6.260620
##   20  14.68951  0.7176696  6.563690
##   24  14.90202  0.7097077  6.701584
## 
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was k = 8.
## [1] 3.319044
## [1] 14.92962
## Warning in train.default(x, y, weights = w, ...): cannnot compute class
## probabilities for regression
## k-Nearest Neighbors 
## 
## 4463 samples
##    2 predictor
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 4015, 4017, 4017, 4017, 4018, 4017, ... 
## Resampling results across tuning parameters:
## 
##   k   RMSE      Rsquared   MAE     
##    4  15.39637  0.7381954  6.688300
##    8  15.07558  0.7466156  6.615964
##   12  15.12283  0.7444119  6.712862
##   20  15.54512  0.7305696  7.023439
##   24  15.77860  0.7225516  7.186679
## 
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was k = 8.
## [1] 3.669267
## [1] 16.43384
## Source : https://maps.googleapis.com/maps/api/staticmap?center=40.76,-73.96&zoom=12&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx
## Warning in train.default(x, y, weights = w, ...): cannnot compute class
## probabilities for regression

## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine